package top.kaoshanji.p3ch11a;

import top.kaoshanji.p3ch11a.support.UserHolder;

/**
 * 代码清单-p3ch11a-342页b：在构造方法中添加当前对象的引用的错误示例
 * author kaoshanji
 * ^_^
 * create time 2025/2/3 16:42
 */
public class WrongUser {

    private final String name;

    public WrongUser(String name) {
        // 在构造器里把对象赋给另外的对象了
        UserHolder.user = this;
        this.name = name;
    }
}
